﻿/**********************************天使物流*******************************************
* 功能描述:物资管理——物资采购
* 作者:孟帅龙
* 时间:2022/1/10
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.Materials.PurchaseRequests;
using Volo.Abp.Application.Services;

namespace TianShiProject.Materials.PurchaseRequests
{
    public class PurchaseRequestService : ApplicationService
    {
        private readonly IPurchaseRequestRepository _purchaseRequestRepository;
        public PurchaseRequestService(IPurchaseRequestRepository purchaseRequestRepository)
        {
            _purchaseRequestRepository= purchaseRequestRepository;
        }

        #region 物资采购——查询分页显示
        /// <summary>
        /// 物资采购——查询分页显示
        /// </summary>
        /// <param name="GoodsName"></param>
        /// <param name="Texture"></param>
        /// <param name="Nationw"></param>
        /// <param name="Province"></param>
        /// <param name="Applicatp"></param>
        /// <param name="AuditStatep"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<PurchaseRequestDto>> GetPurchaseRequestPageShow(string GoodsName, int Texture, int Nationw, int Province, string Applicatp, int AuditStatep, int pageindex = 1, int pagesize = 3)
        {
            return await _purchaseRequestRepository.GetPurchaseRequestPageShow(GoodsName, Texture, Nationw, Province, Applicatp, AuditStatep, pageindex, pagesize);
        }
        #endregion

        #region 物资采购——逻辑删除
        /// <summary>
        /// 物资采购——逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeletePurchaseRequest(int id)
        {

            return await _purchaseRequestRepository.DeletePurchaseRequest(id);
        }
        #endregion

        #region 物资采购——批量删除
        /// <summary>
        /// 物资采购——批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<int> DeleteBatchPurchaseRequest(string ids)
        {
            return await _purchaseRequestRepository.DeleteBatchPurchaseRequest(ids);
        }
        #endregion

        #region 物资采购——编辑
        /// <summary>
        /// 物资采购——编辑
        /// </summary>
        /// <param name="purchaseRequestDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdatePurchaseRequest(PurchaseRequestDto purchaseRequestDto)
        {
            return await _purchaseRequestRepository.PutUpdatePurchaseRequest(purchaseRequestDto);
        }
        #endregion

        #region 物资采购——添加
        /// <summary>
        /// 物资采购——添加
        /// </summary>
        /// <param name="purchaseRequestDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddPurchaseRequest(PurchaseRequestDto purchaseRequestDto)
        {
            return await _purchaseRequestRepository.PostAddPurchaseRequest(purchaseRequestDto);
        }
        #endregion
    }
}
